package com.mql.ganio.model.response;

import android.os.Parcel;
import android.os.Parcelable;

import com.mql.ganio.model.BaseResp;

import java.util.ArrayList;

/**
 * 作者：Administrator on 2017/11/7 12:34
 */
public class LoginResponse extends BaseResp<LoginResponse.DataBean> {



    public static class DataBean implements Parcelable {
//      isFirst 以家庭为单位，是否是第一次登录:0否  1是
//      role  1任课老师  2班主任  4课程顾问 0-家长 5-双重身份
//        isRelation：0-没有绑定亲属关系；1-已经绑定亲属关系

        /**
         * isFirst : 1
         * isRelation : 1
         * phoneNum : 18611467501
         * role : 0
         * relationList : relationName
         * rongToken : F1z1WSwZAPwVjzfeSBzn1n8ttTkVQJIzOeUzPlrhY/1QZ1VXQA2aWboRp/5f9NbVHUlMShhgxcJuOgQNAcFfyg==
         * userId : 139
         */

        private String isFirst;
        private String isRelation;
        private String phoneNum;
        private String role;
        private ArrayList<RelationListBean> relationList;
        private String rongToken;
        private String userCode;
        private String userId;
        private String userName;
        private String headIconUrl;
        private String token;

        public String getToken() {
            return token;
        }

        public void setToken(String token) {
            this.token = token;
        }

        public String getUserName() {
            return userName;
        }

        public void setUserName(String userName) {
            this.userName = userName;
        }

        public String getIsFirst() {
            return isFirst;
        }

        public void setIsFirst(String isFirst) {
            this.isFirst = isFirst;
        }

        public String getIsRelation() {
            return isRelation;
        }

        public void setIsRelation(String isRelation) {
            this.isRelation = isRelation;
        }

        public String getPhoneNum() {
            return phoneNum;
        }

        public void setPhoneNum(String phoneNum) {
            this.phoneNum = phoneNum;
        }

        public String getRole() {
            return role;
        }

        public void setRole(String role) {
            this.role = role;
        }

        public ArrayList<RelationListBean> getRelationList() {
            return relationList;
        }

        public void setRelationList(ArrayList<RelationListBean> relationList) {
            this.relationList = relationList;
        }

        public String getRongToken() {
            return rongToken;
        }

        public void setRongToken(String rongToken) {
            this.rongToken = rongToken;
        }

        public String getUserCode() {
            return userCode;
        }

        public void setUserCode(String userCode) {
            this.userCode = userCode;
        }

        public String getUserId() {
            return userId;
        }

        public void setUserId(String userId) {
            this.userId = userId;
        }

        public String getHeadIconUrl() {
            return headIconUrl;
        }

        public void setHeadIconUrl(String headIconUrl) {
            this.headIconUrl = headIconUrl;
        }

        public static class RelationListBean implements Parcelable {
            /**
             * ifSelected : false
             * relationName : 妈妈
             */

            private String ifSelected;
            private String relationName;
            private boolean checkState;

            public boolean isCheckState() {
                return checkState;
            }

            public void setCheckState(boolean checkState) {
                this.checkState = checkState;
            }

            public String getIfSelected() {
                return ifSelected;
            }

            public void setIfSelected(String ifSelected) {
                this.ifSelected = ifSelected;
            }

            public String getRelationName() {
                return relationName;
            }

            public void setRelationName(String relationName) {
                this.relationName = relationName;
            }

            public RelationListBean() {
            }

            @Override
            public int describeContents() {
                return 0;
            }

            @Override
            public void writeToParcel(Parcel dest, int flags) {
                dest.writeString(this.ifSelected);
                dest.writeString(this.relationName);
                dest.writeByte(this.checkState ? (byte) 1 : (byte) 0);
            }

            protected RelationListBean(Parcel in) {
                this.ifSelected = in.readString();
                this.relationName = in.readString();
                this.checkState = in.readByte() != 0;
            }

            public static final Creator<RelationListBean> CREATOR = new Creator<RelationListBean>() {
                @Override
                public RelationListBean createFromParcel(Parcel source) {
                    return new RelationListBean(source);
                }

                @Override
                public RelationListBean[] newArray(int size) {
                    return new RelationListBean[size];
                }
            };
        }

        @Override
        public int describeContents() {
            return 0;
        }

        @Override
        public void writeToParcel(Parcel dest, int flags) {
            dest.writeString(this.isFirst);
            dest.writeString(this.isRelation);
            dest.writeString(this.phoneNum);
            dest.writeString(this.role);
            dest.writeList(this.relationList);
            dest.writeString(this.rongToken);
            dest.writeString(this.userCode);
            dest.writeString(this.userId);
            dest.writeString(this.userName);
            dest.writeString(this.headIconUrl);
            dest.writeString(this.token);
        }

        public DataBean() {
        }

        @Override
        public String toString() {
            return "DataBean{" +
                    "isFirst='" + isFirst + '\'' +
                    ", isRelation='" + isRelation + '\'' +
                    ", phoneNum='" + phoneNum + '\'' +
                    ", role='" + role + '\'' +
                    ", relationList=" + relationList +
                    ", rongToken='" + rongToken + '\'' +
                    ", userCode='" + userCode + '\'' +
                    ", userId='" + userId + '\'' +
                    ", userName='" + userName + '\'' +
                    ", headIconUrl='" + headIconUrl + '\'' +
                    ", token='" + token + '\'' +
                    '}';
        }

        protected DataBean(Parcel in) {
            this.isFirst = in.readString();
            this.isRelation = in.readString();
            this.phoneNum = in.readString();
            this.role = in.readString();
            this.relationList = new ArrayList<RelationListBean>();
            in.readList(this.relationList, RelationListBean.class.getClassLoader());
            this.rongToken = in.readString();
            this.userCode = in.readString();
            this.userId = in.readString();
            this.userName = in.readString();
            this.headIconUrl = in.readString();
            this.token = in.readString();
        }

        public static final Creator<DataBean> CREATOR = new Creator<DataBean>() {
            @Override
            public DataBean createFromParcel(Parcel source) {
                return new DataBean(source);
            }

            @Override
            public DataBean[] newArray(int size) {
                return new DataBean[size];
            }
        };
    }
}
